Move to the Screenplay 2.x packages and report the codes they assign - #66
Conversation
Cratis.Screenplay 1.6.4 to 2.1.0, with the two packages built against it moved in the same step: Cratis.Arc.Screenplay to 21.2.0 and the Prologue packages to 1.2.0. Both embed the compiler's syntax types, which are positional records, so a version of either built against Screenplay 1.x resolves against 2.1.0, compiles clean and then throws MissingMethodException the first time a document is generated. Arc.Screenplay 21.1.0 is not enough - it still depends on Screenplay 1.5.2; only 21.2.0 is the 2.x rebuild. Chronicle packages to 16.21.0, which also moves the transitive Cratis.Arc.MongoDB off 21.0.0 and its unlisted SharpCompress dependency.
Screenplay 2.x assigns every diagnostic a stable PLAY code. The code was being thrown away and reported as empty, which was accurate against the 1.x compiler and left every diagnostic from 'screenplay validate' impossible to look up, suppress or match on.
The generator and the compiler it is built against meet only at run time, so a mismatched pair of packages builds clean and passes every spec and then throws MissingMethodException the first time anyone runs 'screenplay generate'. Nothing in the suite ran the generator, so that class of failure could only be found by hand. Generating is separated from loading so it can be driven from a compilation built from source. Loading one from disk needs an MSBuild workspace, which starts a build host process of its own and is neither quick nor reliable enough to sit in front of this.
|
Reviewer context — none of this belongs in the release notes. Why all three Screenplay-consuming packages move together
Measured on a deliberately skewed build (Screenplay 2.1.0 with Arc.Screenplay 21.0.1 and Prologue.Screenplay 1.1.0): Two traps worth knowing about:
The new spec
Generating is separated from loading ( Two gaps I did not close: the MSBuild loading path above, and the Prologue side of the same diamond — Why
|
dotnet build Cli.slnx -c Debug |
0 errors, 0 warnings |
dotnet build Cli.slnx -c Release |
0 errors, 0 warnings |
dotnet test -c Debug -f net10.0 |
436/436, 3 consecutive runs |
dotnet test -c Release -f net10.0 |
436/436, 3 consecutive runs |
Documentation/verify-markdown.sh |
33 files, 36 links, all passed |
| restore | clean, no NU1605 |
Live, against the real assets/demo-store:
$ cratis screenplay generate assets/demo-store/DemoStore.csproj
domain Bookshop
module Bookshop
feature Bookshop
slice Automation Bookshop
event BookAddedToInventory
...
$ cratis screenplay validate MyApp.play -o plain
errors (1):
error PLAY0027: [MyApp.play(5,5)] Invalid slice declaration 'slice Reserving' - expected 'slice <Type> <Name>'
$ cratis prologue interpret ./captures --file Captured.play
{ "systemName": "Books", "modules": 2, "features": 2, "slices": 2 }
The validate line is the user-facing change, and it matches the sample the reference documentation now shows.
On the hazards named in #64
IEventSequence.Revise— does not apply.IEventSequenceappears nowhere in this repository; the CLI talks to Chronicle through the gRPC contracts (services.EventSequences.GetEventsFromEventSequenceNumber(...)), not the client-side abstraction, so there is nothing here to leave unimplemented.SharpCompress/NU1605— was genuinely present and is now gone.Cratis.Chronicle.XUnit.Integration16.19.1 pulledCratis.Arc.MongoDB21.0.0, which is the pre-21.0.3 version with the unlisted dependency. 16.21.0 pulls 21.1.0, which declares the listedSharpCompress 0.50.4. Restore is clean.- Arc built against the matching Chronicle — coherent, and not something this PR picks.
Cratis.Arc.Screenplayhas no Chronicle dependency at all (Cratis.Screenplay,Microsoft.CodeAnalysis.CSharp,System.Text.Json,System.Collections.Immutable), so it cannot skew against Chronicle. The full Arc stack enters only throughCratis.Chronicle.XUnit.Integration16.21.0, which pinsCratis.Arc [21.1.0, )itself — the pairing is Chronicle's own choice, inherited rather than selected here.
One thing left deliberately behind
Cratis.Chronicle.* 16.22.0 was published at 16:43 today, after the set for this PR was agreed. I have stayed on 16.21.0 rather than silently taking a version that is an hour old and unreviewed. Worth noting that the scheduled Update Packages workflow has failed every day since 2026-08-05, so nothing is picking these up automatically.
Chronicle 16.20.0 flips the default of skipTlsValidation: the client validated nothing by default and now validates the server certificate unless the connection string opts out. The CLI's own default server is chronicle://localhost:35000 with nothing else on it, and a development server serves a self-signed certificate, so every local connection starts failing with "The SSL connection could not be established" - 108 of the 161 integration specs. That is a breaking change for the most common way the CLI is used and wants deciding on its own terms rather than arriving inside a Screenplay bump. 16.19.3 is the last version with the old default.
|
Correction to the above — the Chronicle bump landed on 16.19.3, not 16.21.0, and the reason is worth a decision of its own. Chronicle 16.20.0 flips the TLS defaultThe first CI run failed 108 of the 161 integration specs with
Only the client packages matter; Decompiling - /// The client always connects over TLS but does not validate the server's certificate by default,
- /// accepting any certificate, including self-signed ones. Set skipTlsValidation=false to
- /// require full certificate chain validation instead
+ /// The client always connects over TLS and validates the server certificate by default. Set
+ /// skipTlsValidation=true only for an explicitly trusted development server whose
+ /// certificate cannot be validated.Upstream updated its own Why that stops this PR taking itThe CLI's default server is That is a breaking change to the most common way the CLI is used, so it does not belong in a Worth its own issue and PR, where the real question can be answered: whether the CLI should default Two other things found on the way
Verification after the change
|
Changed
screenplay validatereports the diagnostic code the compiler assigns, for exampleerror PLAY0027:, alongside the file and position it already carriedCratis.Screenplayto 2.1.0,Cratis.Arc.Screenplayto 21.2.0, theCratis.Prologuepackages to 1.2.0 and theCratis.Chroniclepackages to 16.19.3 (Upgrade to Arc 21, Chronicle 16.19.2 and Fundamentals 7.17.1 #64)